home *** CD-ROM | disk | FTP | other *** search
- Path: info.spt.net.cn!usenet
- From: Xu Yifeng <jafd@public.sta.net.cn>
- Newsgroups: comp.lang.c++,comp.lang.c,alt.msdos.programmer
- Subject: Re: Error with Watcom's Graphics Routines
- Date: Tue, 23 Jan 1996 18:38:04 -0800
- Organization: Shanghai Post & Telecommunication
- Message-ID: <31059B8C.46B6@public.sta.net.cn>
- References: <xanthasDLLDBp.LK7@netcom.com>
- NNTP-Posting-Host: ts1-25.sta.net.cn
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b6 (Win16; I)
-
- Mike Day wrote:
- |>
- |> [ note: this message is crossposted (because it relates to each) to the
- |> following newsgroups:
- |> comp.lang.c
- |> comp.lang.c++
- |> alt.msdos.programmer ]
- |>
- |> Hello...
- |>
- |> I believe I have found an error in Watcom's Graphics Routines,
- |> specifically, the ones used to detect the video configuration and cursor
- |> position.
- |>
- |> I have the following code I call a few times throught my program to
- |> detect these things:
- |>
- |> // Get dimensions of screen
- |> videoconfig vc;
- |> _getvideoconfig(&vc);
- |> oldrows = rows = vc.numtextrows;
- |> oldcols = cols = vc.numtextcols;
- |>
- |> // Save the screen and position/color
- |> oldcolor = _gettextcolor();
- |> oldbkcolor = _getbkcolor();
- |> screensaved = (rows * cols) << 1;
- |> if (screensave) free(screensave);
- |> screensave = (char *) malloc(screensaved);
- |> if (screensave) memcpy(screensave,(void *)0x000b8000,screensaved);
- |> oldpos = _gettextposition();
- |>
- |> I used printf and a delay to see what this code got me each time I ran it,
- |> and it always gives me the same values for rows, cols, and oldpos as when
- |> I call it at the beginning of the program, even after changing text modes.
- |> (80x50, 80x25, etc.) It seems that watcom only detects this information
- |at
- |> the beginning of a program and nowhere thereafter, even when you call its
- |> functions. I am changing the text mode with bios calls, not calls to the
- |> watcom graphics library, so perhaps that is a problem...
- |>
- |> If you have experienced this problem, have suggestions or a solution,
- |> please email me at the address in my .sig.
- |>
- |> Thanks.
- |> --
- |> Mike Day (Omni-)
- |> xanthas@netcom.com
-
- It shouldn't be thought as a problem of Watcom C++ graphics library,
- it has internal graph driver and maintains some structures, you
- shouldn't bypass the library to change something because the driver
- doesn't always call the BIOS.
- for example, are you always bypass the MS-Windows and directly call
- ROM bios when you write Windows program?
-
- Good luck,
- Xu Yifeng
-